package com.songlanyun.modules.faq.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.songlanyun.common.drive.RootEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 常见问题
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2020-12-30 16:30:06
 */
@Data
@TableName("sys_faq")
public class SysFaqEntity extends RootEntity<Long, SysFaqEntity> implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId
    private Long id;
    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空")
    @Length(min = 1, max = 100, message = "标题长度在100字以内")
    private String title;
    /**
     * 内容
     */
    @NotBlank(message = "内容不能为空")
    private String content;
    /**
     *
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 排序号
     */
    @NotNull(message = "排序号不能为空")
    private Integer sort;

    @Override
    public Long getIdentity() {
        return id;
    }
}
